package com.ruoyi.jpbi.service.impl;

import com.ruoyi.jpbi.domain.konggu.Tree;
import com.ruoyi.jpbi.domain.konggu.Jobs;
import com.ruoyi.jpbi.mapper.JobsMapper;
import com.ruoyi.jpbi.mapper.OrgnMapper;
import com.ruoyi.jpbi.service.JobsService;

import com.ruoyi.jpbi.util.TreeBulid;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class JobsServiceImpl implements JobsService {
    @Autowired
    JobsMapper jobsMapper;
    @Autowired
    OrgnMapper orgnMapper;

    @Override
    public List<String> findSubdepartmentID(List<String> AllID) {
        return jobsMapper.findSubdepartmentID(AllID);
    }

    @Override
    public Tree<T> findAllTree(List<String> AllID,String CompID,String type) {
        return TreeBulid.build(orgnMapper.findAllTree(AllID,CompID,type));
    }

    @Override
    public List<Jobs> findAllJobs(String id,String type,Jobs jobs) {
        return jobsMapper.findAllJobs(id,type,jobs);
    }
    @Override
    public Jobs findJobsone(String jobID) {
        return jobsMapper.findJobsone(jobID);
    }

    @Override
    public int updateJobs(Jobs jobs) {
        return jobsMapper.updateJobs(jobs);
    }

    @Override
    public int insertJobs(Jobs jobs) {
        return jobsMapper.insertJobs(jobs);
    }

    @Override
    public int deleteJobs(List<String> jobidList) {
        return jobsMapper.deleteJobs(jobidList);
    }
}
